<?php 
// Header
$this->set('title_for_layout', __("Chỉnh sửa trang tĩnh", true));

$this->left_menu = 'menu/edit_page';

// -- Load CSS : Begin --
echo $this->Html->css('/static_pages/css/add');
echo $this->Html->css('cake.form');
echo $this->Html->css('jstree/tree_component');
// -- Load CSS : End  --

// Load Javascript
echo $this->Html->script('ckeditor/ckeditor_basic');
?>

<div class='right_content'>
<div class="title_left_sidebar">
	<div class="text_title">
		<?php __("Cập nhật trang tĩnh")?>
	</div>
</div>

<?php echo $session->flash()?>

<div class='cake_form'>
<?php 
echo $form->create('StaticPage', array(
	'url'	=>array(
		'plugin'		=>  'static_pages',
		'controller'	=>	'edit_page',	
		'action'		=>	'update',
	),
	'id'		=>	'add_page_form',
	'enctype'	=>	'multipart/form-data'
));
echo $form->input('id');
?>
<label><?php __("Tiêu đề: ")?><font color="red">(*)</font>:</label>
<?php
echo $form->input('title', array(
	'label'	=> false,
	'error'	=>	__("Tiêu đề không được để trống", true)
));

if ($configs['Manage']['edit']['show_alias']) {
	echo $form->input('alias', array('label'	=>	__("Alias: ", true)));
} else {
	echo $form->input('alias', array('label'	=>	__("Alias: ", true), 'type' => 'hidden'));
}
?>


<?php if ($configs['StaticPage']['content']['show']):?>
<div class="input">
<table cellpadding='0' cellspacing='0' border='0' width='100%'>
<tr>
	<td class='label' valign='top'><?php __("Nội dung: ")?><font color="red">(*)</font>:</td>
	<td>
		<?php
		echo $form->input('content', array('label'	=>	false, 'div'=>false, 'type'=>'textarea')); 
		
		if (!isset($configs['StaticPage']['content']['use_rich_text']) || $configs['Agent']['content']['use_rich_text']):
		echo $wysiwyg->render("StaticPage.content", 'ckeditor', $configs['StaticPage']['content_config']);
		endif;
		?>
	</td>
</tr>
</table>
</div>
<?php endif;?>

<div align='center' class='button_panel'>
	<input type='submit' class='button' value='<?php __("Cập nhật")?>'/> 
</div>
<?php echo $form->end();?>
</div>
</div>